package com.example.demo.mapper;

import com.example.demo.pojo.Journal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface JournalMapper {

    @Select("select * from journal")
    List<Journal> findAll();


    @Insert("INSERT INTO journal (type, studentName, studentId, operator, operatorId, time, color) " +
            "VALUES (#{type}, #{studentName}, #{studentId}, #{operator}, #{operatorId}, now(), #{color})")
    int insert(Journal journal);

}
